import classNames from 'classnames'
import { createBrowserRouter, RouterProvider } from 'react-router-dom'

import routes from '@/routes'
import { useThemeStore } from '@/store/ThemeStore'

const router = createBrowserRouter(routes)

function App() {
  const { mode } = useThemeStore(state => state)
  return (
    <div className={classNames('bg-base', `theme-${mode} h-screen`)}>
      <RouterProvider
        router={router}
        fallbackElement={<p>Initial Load...</p>}
      />
    </div>
  )
}

export default App
